package com.jinly.ryder.account.web.mapping;

import com.jinly.ryder.account.service.model.DingTalkUserInfo;
import com.jinly.ryder.account.service.model.UserInfo;
import com.jinly.ryder.account.web.vo.UserInfoVO;
import com.jinly.ryder.common.web.mapping.BaseVOMapping;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.List;

@Mapper(componentModel = "spring")
public interface UserInfoVOMapping extends BaseVOMapping<UserInfoVO, UserInfo> {


    List<UserInfoVO> dingtalkToVoList(List<DingTalkUserInfo> dingTalkUserInfo);

    @Mappings({
            @Mapping(source = "name", target = "nickname"),
            @Mapping(source = "avatar", target = "avatar"),
            @Mapping(source = "mobile", target = "mobile"),
            @Mapping(source = "email", target = "email"),
    })
    UserInfoVO dingtalkToVo(DingTalkUserInfo dingTalkUserInfo);
}
